-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more ways to read scheduled enclave #2620
Conversation
Do you plan adding this method to |
|
It will once we merge #2628 |
at the end decided to keep only one method to obtain scheduled enclave list as through the binary it seems unstable |
@@ -177,6 +176,13 @@ where | |||
})) | |||
}); | |||
|
|||
io.add_sync_method("state_getScheduledEnclaveList", move |_: Params| { | |||
debug!("worker_api_direct rpc was called: state_getScheduledEnclaveList"); | |||
let value = format!("{:?}", &GLOBAL_SCHEDULED_ENCLAVE.registry.read()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This results in something like this:
Ok({0: [177, 155, 22, 22, 112, 239, 100, 252, 239, 19, 10, 78, 170, 5, 181, 229, 13, 234, 219, 91, 29, 160, 23, 147, 133, 219, 42, 14, 151, 253, 19, 134]})
- You should return only value contained in
Result
notResult
itself. - In my opinion value should be serialized directly, not formated to string then serialized.
- Can we have an integration test for this ?
Included integration tests which also addresses next linear issue P-645 : Add test case for scheduled-enclave setting where tests covered:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done
import { createJsonRpcRequest, nextRequestId } from './common/helpers'; | ||
|
||
describe('Scheduled Enclave', function () { | ||
let context: IntegrationTestContext = undefined as any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we define the type and then cast it to any
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question 🤔 this one was copy-paste from another test. I just created chore task to cleanup our tests, as I've also seen some fixme's were copied from one test to another
Context
this PR adds
2 waysa way to read scheduled enclave listvia binary:./bitacross-worker scheduled-enclave
echo '{"jsonrpc":"2.0","method":"state_getScheduledEnclaveList","id":1}' | websocat -n1 -k -B 99999999 wss://localhost:2000